package com.movie.theatre.web.controller;

import com.movie.theatre.web.constant.MqEnum;
import com.movie.theatre.web.producer.MqSendService;
import com.movie.theatre.web.vo.CinemaInfoParamVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HeartBeatController {

    @Autowired
    private MqSendService mqSendService;

    @RequestMapping("/hb")
    public Object hb() {
        return 1;
    }


    @RequestMapping("/test/mq")
    public Object mq() {

        CinemaInfoParamVO cinemaInfoAddParamVO= new  CinemaInfoParamVO();
        cinemaInfoAddParamVO.setEatMeal("rufang");
        cinemaInfoAddParamVO.setSleep("papapa");
        cinemaInfoAddParamVO.setMakeLove("girls");
        mqSendService.sendNormalMessage(cinemaInfoAddParamVO, MqEnum.CINEMA_CLOUD_MQ.getTopic(),"5678");

        return "send mq to cloud!";
    }
}
